This invention relates to invocation map based architecture for program execution.
Current popular software systems make use of two key concepts namely processes and procedure calls to implement any required functionality. The operating system and associated middle-ware is typically implemented as a set of system procedure calls. The applications are implemented as a set of processes, which have their own private data areas that are not accessible to other processes while executing application level code. There are also privilege levels, which allow free access for all system level memory along with address space of application under execution. There are other mechanisms such as shared memory and inter-process messages that help in inter-process communication. The operating system itself makes use of a layered architecture in which a mechanism of messages or shared memory is used to communicate between different layers. In other cases the operating system is designed, as a set of modules containing assorted procedure calls that call each other to accomplish desired functionality.
As indicated above, a typical full-blown software system, which is used for reasonably serious use, contains several layers of software. The layered structure of operating system contains kernel services, over which are layered device drivers, file systems, database engines, transaction monitors and message queuing systems and over and above these are windowing and GUI related software. The complex applications within themselves have many modules and layering. Accomplishing any task involves passing of information through several layers of software back and forth. As each layer is designed to be as general purpose and generic as possible there are chances of sub-optimal implementation and performance penalties. There have also been increasing popularity of data encapsulation and information hiding with the increasing use of object oriented techniques. This again calls for extensive use of messages between different execution units of code. The object-oriented implementations again make use of significant amount of message passing that in turn has scope for performance degradation.
Most of the procedural invocations make use of stacks which implies repeated copying of parameters starting from a procedure that provides inputs all the way to the procedures that performs the last part of processing.
Another point to consider is that a typical end-user executes a set of frequently used and related applications on his system such as a browser, a word-processor, and a spreadsheet program and may be a mail client. If there are mechanisms which allow a tighter integration and collaborative execution by way of easier sharing of data then the system performance can be significantly enhanced.
Even in an industrial strength application, certain execution paths are more frequently used and a tighter integration between the relevant modules can lead to greater execution efficiencies. When the integration is loose, there is lot of duplication of similar functions in different modules and also tendency to grow the size of software by an overwhelming expansion of feature set. This could make the frequently used operations inefficient as they carry the overhead of large amount of rarely used code as part of the execution image.
With the availability of massive parallel, symmetric multi-processor, NUMA and cluster technologies, it becomes possible to migrate applications from a client-server environment to a high performance server centric environment that can exploit the tight integration of disparate elements of the system in one place. Also cheap availability of huge memory pools again opens up new opportunities for architectural innovation. The availability of machines with bigger machine words makes higher liner (virtual) addresses achievable for programs running even on low-end machines.
In summary, existing system architectures, based on stack-oriented parameter passing between procedures, are subject to the following limitations:
Performance penalty owing to the overhead of loading parameters onto the stack and unloading parameters from the stack for each instance of a procedure call,
Unnecessary duplication of similar functions in different modules of an application leading to execution inefficiencies,
Poor integration between frequently used and related application,
Inefficient support of symmetric multiprocessor, parallel computing, NUMA and cluster technologies for performance enhancement.
The object of this invention is to obviate the above mentioned drawbacks and provide an efficient system of parameter passing that avoids unnecessary duplication of functions and supports effective integration of applications and multi-processing environment.
To achieve the said objective, this invention provides in a computing system containing at least one processor, memory and storage devices and input and output devices, said computing system executing software programs in which parameters are passed to procedures characterized in that it includes an invocation map data structure means for passing parameters to a procedure without using the stack for more efficient operation.
The said invocation map data structure means has the facility to be used repeatedly.
The said invocation map data structure means is a shared data repository for several procedures.
The said invocation map data structure means includes the facility to be shared across nested procedures.
The said invocation map data structure means is derived from a hierarchical declaration map means based on calling relationships between procedures, comprising assigning level numbers to each level in the procedure calling hierarchy.
The said invocation map data structure means is constructed to capture the complete hierarchical relationship between the procedures.
A new invocation map data structure means is created and used if the existing invocation map data structure means is in use and a concurrent execution is desired.
A new invocation map data structure means is created or a free invocation map data structure means is used if procedure recursion is required.
The said invocation map data structure means is created with a unique map identification and is structured as follows:
The xe2x80x98use flagxe2x80x99 for a procedure invocation map data structure means is set to xe2x80x981xe2x80x99 at the start of the execution and reset at the end of the execution of a procedure.
The xe2x80x98Save Flagxe2x80x99 in said invocation map data structure means saves the parameters for reuse by a subsequent invocation of the procedure.
The said invocation map data structure means is constructed to initialize any parameter within its enclosed procedural hierarchy including initialization before calling at the structure level so as to avoid creation of multiple copies of the said parameter.
The said invocation map data structure means support recursion and iteration of procedures for which the number of times the procedure will be invoked is known only during run-time.
The data areas for said invocation map data structure means are pre-allocated and can grow along with program execution.
The said invocation map data structure means is declared only once using hierarchical declaration map and referred from anywhere.
The said invocation map data structure means is created as an .imap file during procedure compilation and contains the declaration of the procedure in its own hierarchical map.
The said invocation map data structure means is visible only within the scope of related procedures.
Each invocation of the invocation map data structure means is allocated a separate data area accessible only by its owning thread, such data areas being allocated along with Guard Pages separating each allocation area to avoid possible overlapping.
This invention also provides a method for passing parameters to a procedure characterized in that it uses an invocation map data structure to pass parameters to the procedure without using the stack, for more efficient operation.
The said invocation map data structure can be used repeatedly.
The said invocation map data structure is a shared data repository for several procedures.
The said invocation map data structure can be shared across nested procedures.
The above method includes deriving of said invocation map data structure from a hierarchical declaration map based on calling relationships between procedures comprising assigning level numbers to each level in the procedure calling hierarchy.
The above method includes constructing of said invocation map data structure comprising capturing of the complete hierarchical relationship between the procedures.
The above method includes creating and using of a new invocation map if the existing invocation map is in use and a concurrent execution is desired.
The above method includes creating a new invocation map or using a free invocation map if procedure recursion is required.
The above method includes creating said invocation map data structure with a unique map identification and structuring it as follows:
The above method includes setting the xe2x80x98use flagxe2x80x99 for a procedure invocation map to xe2x80x981xe2x80x99 at the start of the execution and resetting it at the end of the execution of the procedure.
The above method includes setting the xe2x80x98Save Flagxe2x80x99 in said invocation map for saving the parameters for reuse by a subsequent invocation of the procedure.
The above method includes constructing said invocation map to initialize any parameter within its enclosed procedural hierarchy including initialization before calling at the structure level so as to avoid creation of multiple copies of the said parameter.
The above method includes supporting recursion and iteration of procedures for which the number of times the procedure will be invoked is known only during run-time.
The above method includes pre-allocation of the data areas for said invocation map which can grow along with program execution.
The above method includes declaring of said invocation map data structure only once using hierarchical declaration map and the capability of referring to it from anywhere.
The above method includes creating said invocation map data structure as an .imap file during procedure compilation and contains the declaration of the procedure in its own hierarchical map.
The above method includes making said invocation map data structure visible only within the scope of related procedures.
The above method includes allocating a separate data area for each invocation of the invocation map the data being accessible only by its owning thread, such data areas being allocated along with Guard Pages separating each allocation area to avoid possible overlapping.
The instant invention further provides a computer program product comprising a computer readable storage medium having computer readable code embodied therein for causing a computing system to implement parameters passing to a procedure characterized in that it includes computer readable code means configured to cause said computer to pass parameters using an invocation map data structure without using the stack for efficient operation.
The above computer program product includes computer readable code means configured to allow said invocation map data structure to be used repeatedly.
The above computer program product includes computer readable code means configured to operate said invocation map data structure as a shared data repository for several procedures.
The above computer program product includes computer readable code means configured to allow said invocation map data structure to be shared across nested procedures.
The above computer program product includes computer readable code means configured to derive said invocation map data structure from a hierarchical declaration map based on calling relationships between procedures comprising assigning level numbers to each level in the procedure calling hierarchy.
The above computer program product includes computer readable code means configured to construct said invocation map data structure so as to capture the complete hierarchical relationship between the procedures.
The above computer program product includes computer readable code means configured to create and use a new invocation map if the existing invocation map is in use and a concurrent execution is desired.
The above computer program product includes computer readable code means configured to create a new invocation map or use a free invocation map if procedure recursion is required.
The above computer program product includes computer readable code means configured to create said invocation map data structure with a unique map identification and structure it as follows:
The above computer program product includes computer readable code means configured to set the xe2x80x98use flagxe2x80x99 for a procedure invocation map to xe2x80x981xe2x80x99 at the start of the execution and reset it at the end of the execution of a procedure.
The above computer program product includes computer readable code means configured to set the xe2x80x98Save Flagxe2x80x99 in said invocation map to save the parameters for reuse by a subsequent invocation of the procedure.
The above computer program product includes computer readable code means configured to construct said invocation map so as to initialize any parameter within its enclosed procedural hierarchy including initialization before calling at the structure level so as to avoid creation of multiple copies of the said parameter.
The above computer program product includes computer readable code means configured to support recursion and iteration of procedures for which the number of times the procedure will be invoked is known only during run-time.
The above computer program product includes computer readable code means configured to pre-allocate the data areas for said invocation map and permit growth of such areas along with program execution.
The above computer program product includes computer readable code means configured to declare said invocation map data structure only once using hierarchical declaration map and permit referring to it from anywhere.
The above computer program product includes computer readable code means configured to create said invocation map data structure as an imap file during procedure compilation and have it contain the declaration of the procedure in its own hierarchical map.
The above computer program product includes computer readable code means configured to render said invocation map data structure visible only within the scope of related procedures.
The above computer program product includes computer readable code means configured to allocate a separate data area for each invocation map accessible only by its owning thread, such data areas being allocated along with Guard Pages separating each allocation area to avoid possible overlapping.